-
Notifications
You must be signed in to change notification settings - Fork 199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
proto formatting #267
proto formatting #267
Conversation
Warning Rate limit exceeded@beer-1 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 25 minutes and 36 seconds before requesting another review. How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. WalkthroughWalkthroughThe pull request consists of multiple changes across several proto files, primarily involving the reordering of Changes
Possibly related PRs
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.OpenSSF Scorecard
Scanned Manifest Files |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
Outside diff range and nitpick comments (3)
proto/initia/distribution/v1/tx.proto (2)
30-30
: LGTM: Added Amino compatibility and improved formatting.The addition of the
amino.name
option enhances compatibility with the Amino serialization format. The reformatting of theparams
field options improves readability.Consider adding a comment explaining the purpose of the
amino.name
option for better documentation:+ // amino.name is used for Amino JSON serialization compatibility option (amino.name) = "distribution/MsgUpdateParams";
Also applies to: 38-41
53-53
: LGTM: Added Amino compatibility and reorganized options.The addition of the
amino.name
option enhances compatibility with the Amino serialization format. The relocation of thegogoproto.equal
option improves code organization.Consider adding a comment explaining the purpose of the
amino.name
option for better documentation:+ // amino.name is used for Amino JSON serialization compatibility option (amino.name) = "distr/MsgDepositValidatorRewardsPool";
Also applies to: 56-56
Makefile (1)
175-175
: Approve the change to usebuf format
for proto formatting.The switch from
clang-format
tobuf format
for .proto files is a good improvement.buf
is a modern tool specifically designed for working with Protocol Buffers and may provide better formatting options.However, to ensure a smooth transition and maintain consistency, consider the following actions:
- Update the project documentation to mention the use of
buf
for proto formatting.- Ensure that
buf
is available in all development environments and CI/CD pipelines.- Run this new formatting command on all existing .proto files and commit the changes in a separate PR to isolate formatting changes from functional changes.
- Inform the development team about this change and provide guidelines for manually formatting proto files if needed.
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (40)
- Makefile (1 hunks)
- proto/ibc/applications/nft_transfer/v1/genesis.proto (1 hunks)
- proto/ibc/applications/nft_transfer/v1/query.proto (3 hunks)
- proto/ibc/applications/nft_transfer/v1/tx.proto (3 hunks)
- proto/ibc/applications/nft_transfer/v1/types.proto (2 hunks)
- proto/initia/bank/v1/tx.proto (2 hunks)
- proto/initia/distribution/module/v1/module.proto (1 hunks)
- proto/initia/distribution/v1/distribution.proto (4 hunks)
- proto/initia/distribution/v1/genesis.proto (5 hunks)
- proto/initia/distribution/v1/query.proto (7 hunks)
- proto/initia/distribution/v1/tx.proto (3 hunks)
- proto/initia/gov/v1/gov.proto (5 hunks)
- proto/initia/gov/v1/query.proto (3 hunks)
- proto/initia/gov/v1/tx.proto (2 hunks)
- proto/initia/ibchooks/module/v1/module.proto (1 hunks)
- proto/initia/ibchooks/v1/genesis.proto (1 hunks)
- proto/initia/ibchooks/v1/query.proto (4 hunks)
- proto/initia/ibchooks/v1/tx.proto (3 hunks)
- proto/initia/ibchooks/v1/types.proto (2 hunks)
- proto/initia/intertx/module/v1/module.proto (1 hunks)
- proto/initia/intertx/v1/query.proto (2 hunks)
- proto/initia/intertx/v1/tx.proto (3 hunks)
- proto/initia/move/module/v1/module.proto (1 hunks)
- proto/initia/move/v1/auth.proto (1 hunks)
- proto/initia/move/v1/authz.proto (1 hunks)
- proto/initia/move/v1/genesis.proto (1 hunks)
- proto/initia/move/v1/query.proto (12 hunks)
- proto/initia/move/v1/tx.proto (14 hunks)
- proto/initia/move/v1/types.proto (4 hunks)
- proto/initia/mstaking/module/v1/module.proto (1 hunks)
- proto/initia/mstaking/v1/authz.proto (1 hunks)
- proto/initia/mstaking/v1/genesis.proto (2 hunks)
- proto/initia/mstaking/v1/query.proto (11 hunks)
- proto/initia/mstaking/v1/staking.proto (14 hunks)
- proto/initia/mstaking/v1/tx.proto (5 hunks)
- proto/initia/reward/module/v1/module.proto (1 hunks)
- proto/initia/reward/v1/genesis.proto (1 hunks)
- proto/initia/reward/v1/query.proto (2 hunks)
- proto/initia/reward/v1/tx.proto (1 hunks)
- proto/initia/reward/v1/types.proto (1 hunks)
Files skipped from review due to trivial changes (26)
- proto/ibc/applications/nft_transfer/v1/tx.proto
- proto/initia/bank/v1/tx.proto
- proto/initia/distribution/module/v1/module.proto
- proto/initia/gov/v1/query.proto
- proto/initia/ibchooks/module/v1/module.proto
- proto/initia/ibchooks/v1/genesis.proto
- proto/initia/ibchooks/v1/query.proto
- proto/initia/ibchooks/v1/tx.proto
- proto/initia/ibchooks/v1/types.proto
- proto/initia/intertx/module/v1/module.proto
- proto/initia/move/module/v1/module.proto
- proto/initia/move/v1/authz.proto
- proto/initia/move/v1/genesis.proto
- proto/initia/move/v1/query.proto
- proto/initia/move/v1/tx.proto
- proto/initia/move/v1/types.proto
- proto/initia/mstaking/module/v1/module.proto
- proto/initia/mstaking/v1/genesis.proto
- proto/initia/mstaking/v1/query.proto
- proto/initia/mstaking/v1/staking.proto
- proto/initia/mstaking/v1/tx.proto
- proto/initia/reward/module/v1/module.proto
- proto/initia/reward/v1/genesis.proto
- proto/initia/reward/v1/query.proto
- proto/initia/reward/v1/tx.proto
- proto/initia/reward/v1/types.proto
Files skipped from review as they are similar to previous changes (7)
- proto/ibc/applications/nft_transfer/v1/genesis.proto
- proto/ibc/applications/nft_transfer/v1/query.proto
- proto/ibc/applications/nft_transfer/v1/types.proto
- proto/initia/gov/v1/tx.proto
- proto/initia/intertx/v1/query.proto
- proto/initia/move/v1/auth.proto
- proto/initia/mstaking/v1/authz.proto
Additional context used
buf
proto/initia/distribution/v1/query.proto
4-4: import "cosmos/base/query/v1beta1/pagination.proto": file does not exist
(COMPILE)
proto/initia/gov/v1/gov.proto
4-4: import "amino/amino.proto": file does not exist
(COMPILE)
proto/initia/intertx/v1/tx.proto
5-5: import "amino/amino.proto": file does not exist
(COMPILE)
Additional comments not posted (36)
proto/initia/intertx/v1/tx.proto (4)
25-32
: LGTM: Improved formatting in MsgRegisterAccount.The formatting changes in the MsgRegisterAccount message improve readability and consistency. They align with common proto style guides without affecting functionality.
41-48
: LGTM: Consistent formatting improvements in MsgSubmitTx.The formatting changes in the MsgSubmitTx message are consistent with those in MsgRegisterAccount, improving overall readability and maintaining a uniform style throughout the file.
52-52
: LGTM: Minor formatting adjustment.The indentation change in MsgSubmitTxResponse maintains consistency with the rest of the file.
Line range hint
1-52
: Overall LGTM with a note on import verification.The changes in this file are primarily formatting and organization improvements, which enhance readability and maintain consistency. No functional changes were introduced, which is positive.
However, it's crucial to verify the existence and correct path of "amino/amino.proto" as mentioned in a previous comment. If this file is missing or incorrectly referenced, it could lead to compilation issues.
Please review the results of the verification script for "amino/amino.proto" and ensure that this dependency is correctly set up in your project.
proto/initia/distribution/v1/tx.proto (4)
6-8
: LGTM: Import statements reordered for better organization.The reordering of import statements improves code readability without affecting functionality. This change aligns with best practices for organizing imports.
11-13
: LGTM: Option declarations relocated for consistency.The relocation of
go_package
andgogoproto.equal_all
options maintains their original values while likely adhering to a specific style guide. This change enhances code organization without impacting functionality.
59-61
: LGTM: Improved formatting of field declarations.The reformatting of the
depositor
,validator_address
, anddenom
fields enhances readability and maintains consistency with the rest of the file. These changes do not affect functionality.
63-65
: LGTM with a suggestion: Verify the impact of new Amino options.The reformatting and reordering of the
amount
field options improve readability and consistency. The addition of Amino-specific options (amino.encoding
andamino.dont_omitempty
) may affect serialization behavior.Please verify that the addition of Amino options doesn't introduce any unintended changes in serialization behavior. Run the following script to check for any other usages of these options in the codebase:
This will help ensure consistency across the codebase and confirm that these options are used appropriately.
Verification successful
LGTM with a suggestion: Manual verification of Amino options usage.
The reformatting and reordering of the
amount
field options enhance readability and maintain consistency with existing code. The addition of Amino-specific options (amino.encoding
andamino.dont_omitempty
) is consistent with their usage across multiple.proto
files in the codebase, ensuring standardized serialization behavior.Please perform a manual review to confirm that the new Amino options in
proto/initia/distribution/v1/tx.proto
are consistent with their implementation in other files and do not introduce any unintended changes in serialization behavior.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for other usages of amino.encoding and amino.dont_omitempty options echo "Checking for amino.encoding option usage:" rg --type proto 'amino.encoding' echo "Checking for amino.dont_omitempty option usage:" rg --type proto 'amino.dont_omitempty'Length of output: 329
Script:
#!/bin/bash # Description: Check for other usages of amino.encoding and amino.dont_omitempty options in .proto files echo "Checking for amino.encoding option usage:" rg 'amino.encoding' -g "*.proto" echo "Checking for amino.dont_omitempty option usage:" rg 'amino.dont_omitempty' -g "*.proto"Length of output: 4577
proto/initia/distribution/v1/distribution.proto (10)
6-9
: LGTM: Import and option reorderingThe reordering of the import statement and options improves the overall structure and readability of the file. This change follows common proto file organization practices and doesn't affect the functionality.
13-14
: LGTM: Option formatting and additionThe separation of options onto individual lines improves readability. The addition of
(gogoproto.equal) = true
ensures that an Equal method will be generated for the Params message in Go, which can be useful for comparisons.
18-25
: LGTM: Field option formattingThe reformatting of field options improves readability and consistency throughout the Params message. Each field now follows a consistent style, with options on separate lines where appropriate. These changes do not affect the functionality of the code.
32-36
: LGTM: RewardWeight message formattingThe reformatting of the RewardWeight message improves readability and consistency. The weight field's options are now on separate lines, which aligns with the formatting style used elsewhere in the file. These changes are purely cosmetic and do not affect functionality.
42-46
: LGTM: Pool message formattingThe reformatting of the Pool message enhances readability and maintains consistency with the rest of the file. The coins field's options are now on separate lines, which improves clarity. These changes are cosmetic and do not alter the message's functionality.
52-56
: LGTM: DecPool message formattingThe DecPool message has been reformatted to improve readability and maintain consistency with the rest of the file. The dec_coins field's options are now on separate lines, which enhances clarity. These changes are purely cosmetic and do not affect the message's functionality.
74-76
: LGTM: ValidatorHistoricalRewards message formattingThe reformatting of the cumulative_reward_ratios field in the ValidatorHistoricalRewards message improves readability and maintains consistency with the rest of the file. The field's options are now on separate lines, which enhances clarity. These changes are cosmetic and do not alter the message's functionality.
85-89
: LGTM: ValidatorCurrentRewards message formattingThe reformatting of the rewards field in the ValidatorCurrentRewards message enhances readability and maintains consistency with the rest of the file. The field's options are now on separate lines, which improves clarity. These changes are purely cosmetic and do not affect the message's functionality.
97-99
: LGTM: Consistent formatting across multiple messagesThe reformatting applied to ValidatorAccumulatedCommission, ValidatorOutstandingRewards, ValidatorSlashEvent, and ValidatorSlashEvents messages improves overall readability and maintains consistency throughout the file. In each message, the field options are now on separate lines, which enhances clarity. These changes are cosmetic and do not alter the functionality of any of the messages.
Also applies to: 106-110, 118-122, 128-132
157-164
: LGTM: DelegationDelegatorReward message formattingThe reformatting of the DelegationDelegatorReward message enhances readability and maintains consistency with the rest of the file. The message options and field options are now on separate lines, which improves clarity. These changes are purely cosmetic and do not affect the message's functionality.
proto/initia/distribution/v1/genesis.proto (11)
6-11
: LGTM: Import and option reordering looks good.The reordering of imports and package options improves readability and maintains a consistent style across the codebase. These changes do not affect the functionality of the code.
Line range hint
14-25
: LGTM: Formatting improvements in ValidatorOutstandingRewardsRecord.The changes improve readability by aligning options vertically and maintaining consistent formatting. These are good practices for Proto files and do not affect the functionality.
31-41
: LGTM: Formatting improvements in ValidatorAccumulatedCommissionRecord.The changes enhance readability by aligning options vertically and maintaining consistent formatting. These adjustments follow good Proto file practices and do not impact the functionality.
Line range hint
47-60
: LGTM: Formatting improvements in ValidatorHistoricalRewardsRecord.The changes improve readability by aligning options vertically and maintaining consistent formatting. These adjustments adhere to good Proto file practices and do not affect the functionality.
65-75
: LGTM: Formatting improvements in ValidatorCurrentRewardsRecord.The changes enhance readability by aligning options vertically and maintaining consistent formatting. These adjustments follow good Proto file practices and do not impact the functionality.
Line range hint
80-93
: LGTM: Formatting improvements in DelegatorStartingInfoRecord.The changes improve readability by aligning options vertically and maintaining consistent formatting. These adjustments adhere to good Proto file practices and do not affect the functionality.
Line range hint
98-111
: LGTM: Formatting improvements in ValidatorSlashEventRecord.The changes enhance readability by aligning options vertically and maintaining consistent formatting. These adjustments follow good Proto file practices and do not impact the functionality.
116-135
: LGTM: Formatting improvements in GenesisState (part 1).The changes improve readability by aligning options vertically and maintaining consistent formatting for the Params, FeePool, and DelegatorWithdrawInfo fields. These adjustments adhere to good Proto file practices and do not affect the functionality.
141-150
: LGTM: Formatting improvements in GenesisState (part 2).The changes enhance readability by aligning options vertically and maintaining consistent formatting for the ValidatorOutstandingRewardsRecord and ValidatorAccumulatedCommissionRecord fields. These adjustments follow good Proto file practices and do not impact the functionality.
153-162
: LGTM: Formatting improvements in GenesisState (part 3).The changes improve readability by aligning options vertically and maintaining consistent formatting for the ValidatorHistoricalRewardsRecord and ValidatorCurrentRewardsRecord fields. These adjustments adhere to good Proto file practices and do not affect the functionality.
165-174
: LGTM: Formatting improvements in GenesisState (part 4) and overall file assessment.The changes enhance readability by aligning options vertically and maintaining consistent formatting for the DelegatorStartingInfoRecord and ValidatorSlashEventRecord fields. These adjustments follow good Proto file practices and do not impact the functionality.
Overall, the changes in this file are purely formatting-related and improve the readability and consistency of the Proto definitions. The modifications align with best practices for Proto file formatting and do not introduce any functional changes or potential issues.
proto/initia/gov/v1/gov.proto (7)
18-26
: Improved formatting forParams
message andmin_deposit
field.The reformatting of the
Params
message options and themin_deposit
field improves code readability without changing functionality. This change aligns with protobuf best practices.
30-41
: Consistent formatting applied to duration fields.The reformatting of
max_deposit_period
,voting_period
, andexpedited_voting_period
fields improves code readability and maintains consistency across all duration fields in theParams
message.Also applies to: 71-75
83-86
: Improved formatting forexpedited_min_deposit
field.The reformatting of the
expedited_min_deposit
field enhances code readability and maintains consistency with other similar fields in theParams
message.
123-126
: Improved formatting forVesting
field.The reformatting of the
Vesting
field enhances code readability and maintains consistency with other fields in theParams
message.
132-132
: Improved formatting forVesting
message options.The reformatting of the
Vesting
message options improves code readability and aligns with protobuf best practices.
4-11
: Import statements have been reordered and new imports added.The reordering of import statements improves the organization of the file. However, there's a potential issue with one of the imports.
The static analysis tool flags that
amino/amino.proto
does not exist. Please verify if this import is necessary and available in your project structure. If it's a false positive, you may need to update your build configuration or ignore rules.To verify the existence of the
amino/amino.proto
file, you can run the following command:If the file exists, this is likely a false positive from the static analysis tool. If it doesn't exist, please remove or correct the import.
Tools
buf
4-4: import "amino/amino.proto": file does not exist
(COMPILE)
105-115
: New emergency proposal fields added with consistent formatting.The addition of
emergency_min_deposit
andemergency_tally_interval
fields suggests the introduction of an emergency proposal feature. The formatting is consistent with other fields in theParams
message.To ensure proper documentation of these new fields, please run the following command to check if there are any updates to the module's documentation:
If no documentation changes are found, consider updating the module's documentation to explain the new emergency proposal feature and its parameters.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #267 +/- ##
=======================================
Coverage 40.72% 40.72%
=======================================
Files 264 264
Lines 25255 25255
=======================================
Hits 10286 10286
Misses 13374 13374
Partials 1595 1595 |
Description
Closes: #XXXX
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
in the type prefix if API or client breaking changeReviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...